#include "target_config.h"
#include "flash_32.c"
#include "flash_3.c"
#include "flash_opt.c"

// target information
static const sector_info_t sectors_info[] = {
    {MM32SPIN0230_32_flash_start, MM32SPIN0230_32_sector_size},
    {MM32SPIN0230_3_flash_start, MM32SPIN0230_3_sector_size},
    {MM32SPIN_OPT_flash_start, MM32SPIN_OPT_sector_size},
};
target_cfg_t target_device = {
    .version = kTargetConfigVersion,
    .sectors_info = sectors_info,
    .sector_info_length = (sizeof(sectors_info)) / (sizeof(sector_info_t)),
    .flash_regions[0].start = MM32SPIN0230_32_flash_start,
    .flash_regions[0].end = MM32SPIN0230_32_flash_start + MM32SPIN0230_32_flash_size,
    .flash_regions[0].flags = kRegionIsDefault,
    .flash_regions[0].flash_algo = (program_target_t *)&MM32SPIN0230_32_flash,

    .flash_regions[1].start = MM32SPIN0230_3_flash_start,
    .flash_regions[1].end = MM32SPIN0230_3_flash_start + MM32SPIN0230_3_flash_size,
    .flash_regions[1].flags = kRegionIsDefault,
    .flash_regions[1].flash_algo = (program_target_t *)&MM32SPIN0230_32_flash,
    
    .flash_regions[2].start = MM32SPIN_OPT_flash_start,
    .flash_regions[2].end = MM32SPIN_OPT_flash_start + MM32SPIN_OPT_sector_size,
    .flash_regions[2].flags = kRegionIsDefault,
    .flash_regions[2].flash_algo = (program_target_t *)&MM32SPIN_OPT_flash,

    .ram_regions[0].start = 0x20000000,
    .ram_regions[0].end = 0x20001000,
    .erase_reset = 1,
    .target_vendor = "MindMotion",
    .target_part_number = "MM32SPIN0230",
};
